
import Api from '@/services/api.js';
import { mapping } from '@/mixin/mixins/mapping';
const app = getApp()
export default {
  mixins: [mapping],
  components: {
  },
  data() {
    return {
      list: [],
      payload: {
        pageNo: 0,
        // pageSize: 10
      }
    }
  },
  onLoad(options) {
    this.initData();
  },
  onShow() {
  },
  computed: {
    privacyData() {
      return this.$store.state.privacyData;
    }
  },
  async mounted() {
  },
  methods: {
    initData() {
      this.getAccountRecord();
    },
    // 获取账户变动记录  type=7 为提现记录
    async getAccountRecord() {
      const { suc, result } = await this.$request({
        url: Api.getAccountRecord,
        method: 'GET',
        data: {
          userId: this.privacyData.userId,
          type: 7,
          ...this.payload
        }
      })
      if (suc) {
        // result.records.map(i => {
        //   i.changeFront =(i.changeFront / 100).toFixed(2);
        // });
        // this.list = result.records;
      }
    },
  },
  // 下拉刷新
  onPullDownRefresh() {
    this.payload.pageNo = 1;
    this.getAccountRecord();
  }
}